<ul class="nav">
    <li style="margin-top:7px;">Hi <strong>{$AppUI->admin_username}</strong></li>
    <li><a href="{$smarty.const.HOST_ADMIN}/logout" id="logout" class="homeButton" title="Log out">Log out</a></li>
</ul>
<div class="navigation" >
	<ul>
		<li class="home">
			<a title="Home" href="{$smarty.const.HOST_ADMIN}/index?country={$AppUI->country}">Home</a>
		</li>
		<li><a href="javascript:void(0)">Parameter</a>
			<ul>
				<!--{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0001":"F0001":$AppUI->country)}
					{if $AppUI->country =='vi'}
						<li id="category_upload_data"><a  href="{$smarty.const.HOST_ADMIN}/post-data"
							title="Upload Data">Upload Data</a></li>
					{/if}
				{/if} -->
				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0001":"F0002":$AppUI->country)}
					<li class="category-sub-menu" id="category_supplier_calendar"><a  href="{$smarty.const.HOST_ADMIN}/supplier/calendar" title="Supplier Calendar">Supplier Calendar</a></li>
				{/if}
			</ul>
		</li>
		<li> <a href="javascript:void(0)">Replenishment</a>
			<ul>
				
			<!---	{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0002":"F0003":$AppUI->country)}
					{if $AppUI->country =='vi'}
						<li><a class="category-sub-menu" id="category_generate_new_forecast" 
						href="javascript:void(0)" onclick="run_generate();" title="Generate New Forecast">Generate New Forecast</a></li>
					{/if}
				{/if} -->

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0002":"F0004":$AppUI->country)}
					<li class="category-sub-menu" id="category_validate_last_forecast"><a  href="{$smarty.const.HOST_ADMIN}/forecast/?is=0" title="Validate Latest Forecast">Validate Forecast</a></li>
				{/if}

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0002":"F0006":$AppUI->country)}
				<li class="category-sub-menu" id="category_previous_forecast" ><a href="{$smarty.const.HOST_ADMIN}/forecast/current"  title="Current Forecast">Current Forecast</a></li>
				{/if}      

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0002":"F0005":$AppUI->country)}
					<li class="category-sub-menu" id="category_prepare_po"><a  href="{$smarty.const.HOST_ADMIN}/supplier" title="Prepare PO">Prepare PO</a></li>
				{/if}
			</ul>
		</li>
		<li><a href="javascript:void(0)">Archive History</a>
			<ul>
				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0004":"F0011":$AppUI->country)}
					<li  class="category-sub-menu" id="category_view_previous_forecast"><a
					href="{$smarty.const.HOST_ADMIN}/archive-log" title="View Previous Forecast">View Previous Forecast</a></li>
				{/if}
			</ul>
		</li>
		<li><a href="javascript:void(0)">Configuration</a>
			<ul>
				<!---{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0003":"F0007":$AppUI->country)}
					<li  class="category-sub-menu" id="category_create_edit_user"><a
					href="{$smarty.const.HOST_ADMIN}/user" title="Create / Edit User">Create / Edit User</a></li>
				{/if}

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0003":"F0008":$AppUI->country)}
				<li class="category-sub-menu" id="category_change_password"><a  
					href="{$smarty.const.HOST_ADMIN}/user/changepwd" title="Change Password">Change Password</a></li>
				{/if} --->

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0003":"F0009":$AppUI->country)}
				<li class="category-sub-menu"  id="category_content_management"  ><a 
					href="{$smarty.const.HOST_ADMIN}/tooltip" title="Content Management">Content Management</a></li>
				{/if}

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0003":"F0009":$AppUI->country)}
				<li class="category-sub-menu" id="category_priviledge_mamagement"  ><a 
					href="{$smarty.const.HOST_ADMIN}/priviledge" title="Feature Management">Priviledge Management</a></li>
				{/if}

				{if ($AppUI->admin_group_id|dragon_check_priviledge:"G0003":"F0012":$AppUI->country)}
				<li class="category-sub-menu" id="category_holiday_mamagement"  ><a 
					href="{$smarty.const.HOST_ADMIN}/holidays" title="Feature Management">Holidays Management</a></li>
				{/if}
			</ul>
		</li>
		<li><a href="javascript:void(0)">Help</a>
			<ul>
				<!---<li class="category-sub-menu" id="category_flowchart"><a 
						href="{$smarty.const.HOST_ADMIN}/help/flowchart" title="Flowchart">Flowchart</a></li> -->
				<li class="category-sub-menu" id="category_video"><a  
						 href="{$smarty.const.HOST_ADMIN}/video" title="Video">Video</a></li>
				<li class="category-sub-menu" id="category_document" ><a 
						href="{$smarty.const.HOST_ADMIN}/help/document" title="Documentation">Documentation</a></li>      
			</ul>
         </li>      
	</ul>
</div>
{literal}
<script type="text/javascript">
	var gTotalCate	= '{/literal}{$intTotalCate}{literal}';
	var aResult		= new Array();
	var iIndex		= 0;
	
	if(gTotalCate>0)
	{
		for(i=0; i<gTotalCate; i++){
			aResult[i]	= 0;
		}
	}
	
	function run_generate()
	{
		var msg	 = 'Run the calculation for Actual, Target, Minimum stock value. Are you sure?';
		if( !confirm(msg) ){
			return;
		}
		showWaiting();
		do_generate();
	}
	
	function do_generate()
	{
		$.post
		(
			HOST + '/generate/',
			{
				'callback'	: 'abc'
			},
			function(data)
			{
				$.unblockUI();
				alert("System will send email to Buying and Marketing Team");
				$.post
				(
					HOST + '/generate/send-email',
					{
						'callback'	: 'abc'
					},function(data)
					{
					  window.loacation.href = HOST + "/index/index";
					}
				);
				
			}
		);
	}
	
	function check_done()
	{
		var iCheck	= 0;
		for(j=0; j<gTotalCate; j++)
		{
			if(aResult[j]==0 || aResult[j]=='0')
			{
				iCheck	= 1;
				break;
			}
		}
	
		if(iCheck==0){
			$.unblockUI();
		}
		/*$.unblockUI();*/
	}

	$(document).ready(function(){
		$(".category-sub-menu").removeClass("current");
		var cur = $("#currenttab").attr('class');
		$("#" + cur).addClass("current"); 
	}); 
</script>
{/literal}
